package com.loveprogrammer.console;

import com.alibaba.fastjson2.util.DateUtils;

import java.util.Date;

/**
 * @version 1.0.0
 * @description: 输出类
 * @author: eric
 * @date: 2024-02-18 16:55
 **/
public class ConsolePrint {

    private static final String space = "\t\t\t\t\t\t\t\t";

    public static void publishMessage(String content,int position) {
        String format = DateUtils.format(new Date(),DateUtils.DateTimeFormatPattern.DATE_TIME_FORMAT_19_DASH.pattern);
        String threadName = Thread.currentThread().getName();
        if(position == 0) {
            System.out.print(content);
        }else if(position == 1) {
            System.out.println(content);
        }else {
            System.out.println(space + content);
        }
    }

    public static void publishMessage(String content) {
        System.out.println(content);
    }

    public static void publishMessagePrint(String content,String placeholder) {
        System.out.print(content + placeholder);
    }
}
